package com.yjh.admin.server.chronic.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yjh.admin.entity.chronic.PhysicalSigns;
import com.yjh.admin.mapper.chronic.PhysicalSignsMapper;
import com.yjh.admin.server.chronic.PhysicalSignsService;
import org.springframework.stereotype.Service;
import util.R;

import java.util.List;


/**
 * 体征数据
 *
 * @author GuoBin
 * @date 2020-08-11 17:15:12
 */
@Service
public class PhysicalSignsServiceImpl extends ServiceImpl<PhysicalSignsMapper, PhysicalSigns> implements PhysicalSignsService {

    @Override
    public R queryPhysicalSigns(Integer type) {
//		Map<String, Object> map = new HashMap<>();
        QueryWrapper itemQueryWrapper = new QueryWrapper();
        itemQueryWrapper.eq("type",type);
        //map =  JSON.parseObject(JSONObject.toJSONString(baseMapper.selectList(itemQueryWrapper)), Map.class);
        return new R<>(baseMapper.selectList(itemQueryWrapper));
    }

    @Override
    public List<PhysicalSigns> queryPhysicalSignsByType(Integer vipId) {
        return baseMapper.queryPhysicalSignsByType(vipId);
    }

    @Override
    public PhysicalSigns queryPhysicalSignsByOne(Integer equipmentId,Integer custId) {
        return baseMapper.queryPhysicalSignsByOne(equipmentId,custId);
    }

    @Override
    public List<PhysicalSigns> queryPhysicalSignsStatistics(Integer custId,Integer type) {
        return baseMapper.queryPhysicalSignsStatistics(custId,type);
    }
}
